import { type RawGovernanceConfig } from './types.js';

const recommended: RawGovernanceConfig<'built-in'> = {
  rules: {
    struct: 'error',
    'no-unresolved-refs': 'error',
  },
  oas2Rules: {
    'boolean-parameter-prefixes': 'off',
    'info-contact': 'off',
    'info-license': 'warn',
    'info-license-strict': 'warn',
    'no-ambiguous-paths': 'warn',
    'no-duplicated-tag-names': 'warn',
    'no-enum-type-mismatch': 'error',
    'no-http-verbs-in-paths': 'off',
    'no-identical-paths': 'error',
    'no-invalid-parameter-examples': 'warn',
    'no-invalid-schema-examples': 'warn',
    'no-path-trailing-slash': 'error',
    'no-required-schema-properties-undefined': 'warn',
    'no-schema-type-mismatch': 'error',
    'operation-2xx-response': 'warn',
    'operation-4xx-response': 'warn',
    'operation-description': 'off',
    'operation-operationId': 'warn',
    'operation-operationId-unique': 'error',
    'operation-operationId-url-safe': 'error',
    'operation-parameters-unique': 'error',
    'operation-singular-tag': 'off',
    'operation-summary': 'error',
    'operation-tag-defined': 'off',
    'parameter-description': 'off',
    'path-declaration-must-exist': 'error',
    'path-http-verbs-order': 'off',
    'path-not-include-query': 'error',
    'path-params-defined': 'off',
    'path-parameters-defined': 'error',
    'path-segment-plural': 'off',
    'paths-kebab-case': 'off',
    'request-mime-type': 'off',
    'required-string-property-missing-min-length': 'off',
    'response-contains-header': 'off',
    'response-contains-property': 'off',
    'response-mime-type': 'off',
    'scalar-property-missing-example': 'off',
    'security-defined': 'error',
    'spec-strict-refs': 'off',
    'tag-description': 'warn',
    'tags-alphabetical': 'off',
  },
  oas3_0Rules: {
    'array-parameter-serialization': 'off',
    'boolean-parameter-prefixes': 'off',
    'component-name-unique': 'off',
    'info-contact': 'off',
    'info-license': 'warn',
    'info-license-strict': 'warn',
    'no-ambiguous-paths': 'warn',
    'no-duplicated-tag-names': 'warn',
    'no-empty-servers': 'error',
    'no-enum-type-mismatch': 'error',
    'no-example-value-and-externalValue': 'error',
    'no-http-verbs-in-paths': 'off',
    'no-identical-paths': 'error',
    'no-invalid-media-type-examples': {
      severity: 'warn',
      allowAdditionalProperties: false,
    },
    'no-invalid-parameter-examples': 'warn',
    'no-invalid-schema-examples': 'warn',
    'no-path-trailing-slash': 'error',
    'no-required-schema-properties-undefined': 'warn',
    'no-schema-type-mismatch': 'error',
    'no-server-example.com': 'warn',
    'no-server-trailing-slash': 'error',
    'no-server-variables-empty-enum': 'error',
    'no-undefined-server-variable': 'error',
    'no-unused-components': 'warn',
    'nullable-type-sibling': 'error',
    'operation-2xx-response': 'warn',
    'operation-4xx-problem-details-rfc7807': 'off',
    'operation-4xx-response': 'warn',
    'operation-description': 'off',
    'operation-operationId': 'warn',
    'operation-operationId-unique': 'error',
    'operation-operationId-url-safe': 'error',
    'operation-parameters-unique': 'error',
    'operation-singular-tag': 'off',
    'operation-summary': 'error',
    'operation-tag-defined': 'off',
    'parameter-description': 'off',
    'path-declaration-must-exist': 'error',
    'path-http-verbs-order': 'off',
    'path-not-include-query': 'error',
    'path-params-defined': 'off',
    'path-parameters-defined': 'error',
    'path-segment-plural': 'off',
    'paths-kebab-case': 'off',
    'request-mime-type': 'off',
    'required-string-property-missing-min-length': 'off',
    'response-contains-header': 'off',
    'response-contains-property': 'off',
    'response-mime-type': 'off',
    'scalar-property-missing-example': 'off',
    'security-defined': 'error',
    'spec-components-invalid-map-name': 'error',
    'spec-example-values': 'off',
    'spec-strict-refs': 'off',
    'tag-description': 'warn',
    'tags-alphabetical': 'off',
  },
  oas3_1Rules: {
    'array-parameter-serialization': 'off',
    'boolean-parameter-prefixes': 'off',
    'component-name-unique': 'off',
    'info-contact': 'off',
    'info-license': 'warn',
    'info-license-strict': 'warn',
    'no-ambiguous-paths': 'warn',
    'no-duplicated-tag-names': 'warn',
    'no-empty-servers': 'error',
    'no-enum-type-mismatch': 'error',
    'no-example-value-and-externalValue': 'error',
    'no-http-verbs-in-paths': 'off',
    'no-identical-paths': 'error',
    'no-invalid-media-type-examples': 'warn',
    'no-invalid-parameter-examples': 'warn',
    'no-invalid-schema-examples': 'warn',
    'no-path-trailing-slash': 'error',
    'no-required-schema-properties-undefined': 'warn',
    'no-schema-type-mismatch': 'error',
    'no-server-example.com': 'warn',
    'no-server-trailing-slash': 'error',
    'no-server-variables-empty-enum': 'error',
    'no-undefined-server-variable': 'error',
    'no-unused-components': 'warn',
    'operation-2xx-response': 'warn',
    'operation-4xx-problem-details-rfc7807': 'off',
    'operation-4xx-response': 'warn',
    'operation-description': 'off',
    'operation-operationId': 'warn',
    'operation-operationId-unique': 'error',
    'operation-operationId-url-safe': 'error',
    'operation-parameters-unique': 'error',
    'operation-singular-tag': 'off',
    'operation-summary': 'error',
    'operation-tag-defined': 'off',
    'parameter-description': 'off',
    'path-declaration-must-exist': 'error',
    'path-http-verbs-order': 'off',
    'path-not-include-query': 'error',
    'path-params-defined': 'off',
    'path-parameters-defined': 'error',
    'path-segment-plural': 'off',
    'paths-kebab-case': 'off',
    'request-mime-type': 'off',
    'required-string-property-missing-min-length': 'off',
    'response-contains-header': 'off',
    'response-contains-property': 'off',
    'response-mime-type': 'off',
    'scalar-property-missing-example': 'off',
    'security-defined': 'error',
    'spec-components-invalid-map-name': 'error',
    'spec-example-values': 'off',
    'spec-strict-refs': 'off',
    'tag-description': 'warn',
    'tags-alphabetical': 'off',
  },
  oas3_2Rules: {
    'array-parameter-serialization': 'off',
    'boolean-parameter-prefixes': 'off',
    'component-name-unique': 'off',
    'info-contact': 'off',
    'info-license': 'warn',
    'info-license-strict': 'warn',
    'no-ambiguous-paths': 'warn',
    'no-duplicated-tag-names': 'warn',
    'no-empty-servers': 'error',
    'no-enum-type-mismatch': 'error',
    'no-http-verbs-in-paths': 'off',
    'no-identical-paths': 'error',
    'no-invalid-media-type-examples': 'warn',
    'no-invalid-parameter-examples': 'warn',
    'no-invalid-schema-examples': 'warn',
    'no-path-trailing-slash': 'error',
    'no-required-schema-properties-undefined': 'warn',
    'no-schema-type-mismatch': 'error',
    'no-server-example.com': 'warn',
    'no-server-trailing-slash': 'error',
    'no-server-variables-empty-enum': 'error',
    'no-undefined-server-variable': 'error',
    'no-unused-components': 'warn',
    'operation-2xx-response': 'warn',
    'operation-4xx-problem-details-rfc7807': 'off',
    'operation-4xx-response': 'warn',
    'operation-description': 'off',
    'operation-operationId': 'warn',
    'operation-operationId-unique': 'error',
    'operation-operationId-url-safe': 'error',
    'operation-parameters-unique': 'error',
    'operation-singular-tag': 'off',
    'operation-summary': 'error',
    'operation-tag-defined': 'off',
    'parameter-description': 'off',
    'path-declaration-must-exist': 'error',
    'path-http-verbs-order': 'off',
    'path-not-include-query': 'error',
    'path-params-defined': 'off',
    'path-parameters-defined': 'error',
    'path-segment-plural': 'off',
    'paths-kebab-case': 'off',
    'request-mime-type': 'off',
    'required-string-property-missing-min-length': 'off',
    'response-contains-header': 'off',
    'response-contains-property': 'off',
    'response-mime-type': 'off',
    'scalar-property-missing-example': 'off',
    'security-defined': 'error',
    'spec-components-invalid-map-name': 'error',
    'spec-discriminator-defaultMapping': 'warn',
    'spec-example-values': 'error',
    'spec-no-invalid-encoding-combinations': 'error',
    'spec-no-invalid-tag-parents': 'error',
    'spec-strict-refs': 'off',
    'tag-description': 'warn',
    'tags-alphabetical': 'off',
  },
  async2Rules: {
    'channels-kebab-case': 'off',
    'info-contact': 'off',
    'info-license-strict': 'warn',
    'no-channel-trailing-slash': 'off',
    'no-duplicated-tag-names': 'warn',
    'no-enum-type-mismatch': 'error',
    'no-required-schema-properties-undefined': 'warn',
    'no-schema-type-mismatch': 'error',
    'operation-operationId': 'warn',
    'tag-description': 'warn',
    'tags-alphabetical': 'off',
  },
  async3Rules: {
    'channels-kebab-case': 'off',
    'info-contact': 'off',
    'info-license-strict': 'warn',
    'no-channel-trailing-slash': 'off',
    'no-duplicated-tag-names': 'warn',
    'no-enum-type-mismatch': 'error',
    'no-required-schema-properties-undefined': 'warn',
    'no-schema-type-mismatch': 'error',
    'operation-operationId': 'warn',
    'tag-description': 'warn',
    'tags-alphabetical': 'off',
  },
  arazzo1Rules: {
    'criteria-unique': 'warn',
    'no-criteria-xpath': 'off',
    'no-enum-type-mismatch': 'error',
    'no-required-schema-properties-undefined': 'warn',
    'no-schema-type-mismatch': 'error',
    'no-x-security-both-scheme-and-scheme-name': 'off',
    'no-x-security-scheme-name-without-openapi': 'off',
    'parameters-unique': 'error',
    'requestBody-replacements-unique': 'warn',
    'respect-supported-versions': 'off',
    'sourceDescription-name-unique': 'error',
    'sourceDescription-type': 'error',
    'sourceDescriptions-not-empty': 'error',
    'step-onFailure-unique': 'warn',
    'step-onSuccess-unique': 'warn',
    'stepId-unique': 'error',
    'workflow-dependsOn': 'error',
    'workflowId-unique': 'error',
    'x-security-scheme-name-reference': 'off',
    'x-security-scheme-required-values': 'off',
  },
  overlay1Rules: {
    'info-contact': 'off',
  },
};

export default recommended;
